<?php
namespace api\action\vote;

use Yii;
use yii\rest\IndexAction as BaseIndexAction;

class IndexAction extends BaseIndexAction
{
    public function init()
    {
        parent::init();

        $this->dataFilter = [
            'class' => 'yii\data\ActiveDataFilter',
            'searchModel' => function () {
                return (new \yii\base\DynamicModel(['id' => null]))
                    ->addRule('id', 'string');
            },
            'filter' => ['id' => Yii::$app->request->get('id')]
        ];

    }

}
